Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change how Private is implemented to better support type checkers #1437

Merged
merged 3 commits into from
Nov 24, 2021

Conversation

patrick91
Copy link
Member

@patrick91 patrick91 commented Nov 23, 2021

This PR changes how Private is implemented to add support for type checkers, now:

import strawberry

x: strawberry.Private[int]

reveal_type(x)

returns int

This is better as now type checkers won't complain about Private fields :)

@patrick91 patrick91 requested a review from jkimbo November 23, 2021 00:14
@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #1437 (7a928a9) into main (5cba553) will decrease coverage by 0.02%.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##             main    #1437      +/-   ##
==========================================
- Coverage   98.08%   98.06%   -0.03%     
==========================================
  Files         119      119              
  Lines        4129     4134       +5     
  Branches      599      601       +2     
==========================================
+ Hits         4050     4054       +4     
  Misses         42       42              
- Partials       37       38       +1     

Shouldn't be needed anymore
@patrick91 patrick91 changed the title Change how Private is implemented to better support typ checkers Change how Private is implemented to better support type checkers Nov 23, 2021
@botberry
Copy link
Member

botberry commented Nov 23, 2021

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


This release changes how strawberry.Private is implemented to
improve support for type checkers.


Here's the preview release card for twitter:

Here's the tweet text:

🆕 Release (next) is out! Thanks to Patrick Arminio for the PR 👏

Get it here 👉 https://github.com/strawberry-graphql/strawberry/releases/tag/(next)

Copy link
Member

@jkimbo jkimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution 👍

@patrick91 patrick91 merged commit 316ccb2 into main Nov 24, 2021
@patrick91 patrick91 deleted the typing/improve-private-typing branch November 24, 2021 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants